feat: add opt-in LIFO dispatch order#458
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 15 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (24)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
Tier 4 overload control S25 — opt-in per-queue LIFO dispatch order, the last of the tier-4 knobs (after S26 max_pending #449 and S27 CoDel #450).
fifo(default) runs same-priority jobs oldest-first — the fair ordering a durable queue is expected to keep;liforuns newest-first, a freshness lever for workloads that would rather run recent work than clear a stale backlog in order under overload. Priority always dominates — this only breaks same-priority ties. Off by default; nothing changes unless a queue opts in.DispatchOrder{Fifo,Lifo}enum +order_forhelper;orders: &HashMap<String,DispatchOrder>threaded throughdequeue_from/dequeue_batch_fromacross the trait,diesel_common, SQLite, Postgres, Redis, and thedelegate!macro. Diesel flipsscheduled_atasc↔desc for LIFO ties (priority stays desc) with anidtie-break for determinism.Scheduler.dispatch_ordersmap +register_queue_dispatch_order; poller passes it to dequeue.scheduled_at, so per-priority LIFO would need a second score-inverted set.lifois accepted but ignored there, mirroring thelist_jobs_afterRedis note.set_queue_dispatch_order(queue, order); folded into the_queue_configswire JSON.QueueLimits.dispatchOrder; wired throughconfig.rs/worker.rs.Taskito.dispatchOrder(queue, order);encodeQueueConfigsnow emits CoDel + dispatch order per queue via the late-bound supplier.Testing
cargo test --workspace— 183 core tests (LIFO ties dispatch newest-first, FIFO default oldest-first, priority dominates, id determinism);cargo checkdefault/postgres/redis;clippy --all-targets --all-features+doc -D warningscleantest_dispatch_order+ coexistence withtest_admission/test_codel— 16 passed; ruff + mypy cleandispatch-order/codel/admission— 12 passed; tsc + biome cleanDispatchOrderTest3 +CodelTest3 +AdmissionTest6 — all green